﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="clr-namespace:WPFMitsuControlsv2"
  xmlns:s="http://schemas.microsoft.com/surface/2008"
  xmlns:System="clr-namespace:System;assembly=mscorlib"
  xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic"
  >

  <Style TargetType="{x:Type local:Book}">
    <Style.Resources>
      <local:ScrollViewerNotAtEndConverter x:Key="ScrollViewerNotAtEndConverter" />

      <Style x:Key="ScrollBarButton" TargetType="{x:Type s:SurfaceRepeatButton}">

        <Setter Property="Background" Value="{x:Null}"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Focusable" Value="False"/>

        <Setter Property="SnapsToDevicePixels" Value="True" />

        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type s:SurfaceRepeatButton}">
              <ControlTemplate.Resources>
                <Storyboard x:Key="Bouton2" RepeatBehavior="Forever">
                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:02" Value="2" KeySpline="0,0.74,1,1"/>
                  </DoubleAnimationUsingKeyFrames>
                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:02" Value="2" KeySpline="0,0.74,1,1"/>
                  </DoubleAnimationUsingKeyFrames>
                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:01.2000000" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
                  </DoubleAnimationUsingKeyFrames>
                  <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse3" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                    <SplineColorKeyFrame KeyTime="00:00:01.4000000" Value="#73696969"/>
                    <SplineColorKeyFrame KeyTime="00:00:02" Value="#73696969"/>
                    <SplineColorKeyFrame KeyTime="00:00:03" Value="#73161616"/>
                  </ColorAnimationUsingKeyFrames>
                  <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse3" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                    <SplineColorKeyFrame KeyTime="00:00:01.4000000" Value="#4DFFFFFF"/>
                    <SplineColorKeyFrame KeyTime="00:00:02" Value="#4DFFFFFF"/>
                    <SplineColorKeyFrame KeyTime="00:00:03" Value="#4D969696"/>
                  </ColorAnimationUsingKeyFrames>
                  <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4_Copy" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                    <SplineThicknessKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
                    <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="-2"/>
                    <SplineThicknessKeyFrame KeyTime="00:00:01.2000000" Value="-9"/>
                    <SplineThicknessKeyFrame KeyTime="00:00:02" Value="-13"/>
                  </ThicknessAnimationUsingKeyFrames>
                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4_Copy" Storyboard.TargetProperty="(Shape.StrokeThickness)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:01.2000000" Value="2"/>
                  </DoubleAnimationUsingKeyFrames>
                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4" Storyboard.TargetProperty="(Shape.StrokeThickness)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="2"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:01.2000000" Value="1"/>
                  </DoubleAnimationUsingKeyFrames>
                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4_Copy" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:01.2000000" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
                  </DoubleAnimationUsingKeyFrames>
                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4_Copy1" Storyboard.TargetProperty="(Shape.StrokeThickness)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="2"/>
                  </DoubleAnimationUsingKeyFrames>
                  <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4_Copy1" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                    <SplineThicknessKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
                    <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="-1"/>
                    <SplineThicknessKeyFrame KeyTime="00:00:01.2000000" Value="-7"/>
                    <SplineThicknessKeyFrame KeyTime="00:00:03" Value="-13"/>
                  </ThicknessAnimationUsingKeyFrames>
                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4_Copy1" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:01.2000000" Value="1"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:03" Value="0"/>
                  </DoubleAnimationUsingKeyFrames>
                  <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                    <SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
                    <SplineThicknessKeyFrame KeyTime="00:00:01.2000000" Value="0"/>
                    <SplineThicknessKeyFrame KeyTime="00:00:02" Value="1"/>
                  </ThicknessAnimationUsingKeyFrames>
                  <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse4_Copy" Storyboard.TargetProperty="(UIElement.Effect).(BlurEffect.Radius)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="5"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="6"/>
                    <SplineDoubleKeyFrame KeyTime="00:00:01.2000000" Value="5"/>
                  </DoubleAnimationUsingKeyFrames>
                </Storyboard>

              </ControlTemplate.Resources>

              <Grid Height="30" HorizontalAlignment="Left" Width="30">
                <Ellipse x:Name="ellipse4" RenderTransformOrigin="0.5,0.5" Margin="1" Stroke="White" StrokeThickness="2">
                  <Ellipse.RenderTransform>
                    <TransformGroup>
                      <ScaleTransform/>
                      <SkewTransform/>
                      <RotateTransform/>
                      <TranslateTransform/>
                    </TransformGroup>
                  </Ellipse.RenderTransform>
                  <Ellipse.Effect>
                    <BlurEffect/>
                  </Ellipse.Effect>
                </Ellipse>
                <Ellipse x:Name="ellipse4_Copy" RenderTransformOrigin="0.5,0.5" Margin="1" Stroke="#FF3D3D3D" StrokeThickness="2">
                  <Ellipse.RenderTransform>
                    <TransformGroup>
                      <ScaleTransform/>
                      <SkewTransform/>
                      <RotateTransform/>
                      <TranslateTransform/>
                    </TransformGroup>
                  </Ellipse.RenderTransform>
                  <Ellipse.Effect>
                    <BlurEffect/>
                  </Ellipse.Effect>
                </Ellipse>
                <Ellipse x:Name="ellipse4_Copy1" RenderTransformOrigin="0.5,0.5" Margin="1" Stroke="White" StrokeThickness="2">
                  <Ellipse.RenderTransform>
                    <TransformGroup>
                      <ScaleTransform/>
                      <SkewTransform/>
                      <RotateTransform/>
                      <TranslateTransform/>
                    </TransformGroup>
                  </Ellipse.RenderTransform>
                  <Ellipse.Effect>
                    <BlurEffect/>
                  </Ellipse.Effect>
                </Ellipse>
                <Rectangle Stroke="{x:Null}">
                  <Rectangle.Fill>
                    <DrawingBrush>
                      <DrawingBrush.Drawing>
                        <DrawingGroup>
                          <DrawingGroup.Children>
                            <GeometryDrawing Brush="#FFC9C9C9" Geometry="F1 M 108.745,0.00012207C 168.802,0.00012207 217.489,48.6866 217.489,108.745C 217.489,168.803 168.803,217.489 108.745,217.489C 48.6866,217.489 0,168.803 0,108.745C 0,48.6866 48.6867,0.00012207 108.745,0.00012207 Z "/>
                            <GeometryDrawing Brush="#FFE0E0E1" Geometry="F1 M 8.77203,65.8461C 8.36792,67.1132 85.374,77.8467 106.374,122.097C 106.374,122.097 130.711,177.746 216.386,93.5939C 216.386,93.5939 213.12,60.8125 188.662,34.9899C 177.216,22.9056 160.672,10.1146 137.102,3.71277C 133.068,2.61707 109.782,-3.57581 83.72,2.84094C 58.0407,9.16321 25.7199,27.4034 8.77203,65.8461 Z "/>
                          </DrawingGroup.Children>
                        </DrawingGroup>
                      </DrawingBrush.Drawing>
                    </DrawingBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <Ellipse x:Name="ellipse3" Stretch="Fill">
                  <Ellipse.Fill>
                    <RadialGradientBrush RadiusX="0.5" RadiusY="0.5" Center="0.5,0.5" GradientOrigin="0.5,0.5">
                      <RadialGradientBrush.RelativeTransform>
                        <TransformGroup/>
                      </RadialGradientBrush.RelativeTransform>
                      <GradientStop Color="#73161616" Offset="1"/>
                      <GradientStop Color="#4D969696"/>
                    </RadialGradientBrush>
                  </Ellipse.Fill>
                </Ellipse>
              </Grid>


              <ControlTemplate.Triggers>

                <Trigger Property="IsEnabled" Value="true">
                  <Trigger.EnterActions>
                    <BeginStoryboard x:Name="StoryboardLeft" Storyboard="{StaticResource Bouton2}"/>
                  </Trigger.EnterActions>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                  <Trigger.EnterActions>
                    <StopStoryboard BeginStoryboardName="StoryboardLeft"/>
                  </Trigger.EnterActions>
                </Trigger>

              </ControlTemplate.Triggers>

            </ControlTemplate>
          </Setter.Value>
        </Setter>

      </Style>

      <Style x:Key="BookmarksPanelScrollViewerStyle" TargetType="{x:Type s:SurfaceScrollViewer}">
        <Style.BasedOn>
          <Style TargetType="{x:Type s:SurfaceScrollViewer}">
            <Setter Property="Template">
              <Setter.Value>
                <ControlTemplate TargetType="{x:Type s:SurfaceScrollViewer}">
                  <Grid x:Name="grid" HorizontalAlignment="Stretch" Margin="{TemplateBinding Padding}" VerticalAlignment="Stretch" 
                        OpacityMask="{x:Null}" Background="{TemplateBinding Background}">


                    <s:SurfaceScrollBar x:Name="PART_HorizontalScrollBar" HorizontalAlignment="Stretch" MinHeight="30" MinWidth="30" Height="Auto" 
                                        Foreground="{x:Null}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" VerticalAlignment="Center"
                                        Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" 
                                        ScrollViewer.HorizontalScrollBarVisibility="Disabled" AutomationProperties.AutomationId="HorizontalScrollBar" 
                                        Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" LargeChange="1" 
                                        Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" 
                                        Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                                        >
                      <s:SurfaceScrollBar.Style>
                        <Style TargetType="{x:Type s:SurfaceScrollBar}">
                          <Style.Resources>
                            <System:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}">52</System:Double>
                            <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">52</System:Double>
                          </Style.Resources>
                          <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
                          <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
                          <Setter Property="BorderBrush" Value="#33000000"/>
                          <Setter Property="Background">
                            <Setter.Value>
                              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                <GradientStop Color="#33364E5C" Offset="0"/>
                                <GradientStop Color="#0C364E5C" Offset="1"/>
                              </LinearGradientBrush>
                            </Setter.Value>
                          </Setter>
                          <Setter Property="Width" Value="30"/>
                          <Setter Property="MinWidth" Value="30"/>
                          <Setter Property="Height" Value="NaN"/>
                          <Setter Property="MinHeight" Value="30"/>
                          <Setter Property="VerticalAlignment" Value="Stretch"/>
                          <Setter Property="HorizontalAlignment" Value="Stretch"/>
                          <Setter Property="Template">
                            <Setter.Value>
                              <ControlTemplate TargetType="{x:Type s:SurfaceScrollBar}">
                                <ControlTemplate.Resources>
                                  <Storyboard x:Key="Touch">
                                    <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Width" To="30"/>
                                    <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight" To="12"/>
                                    <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth" To="30"/>
                                  </Storyboard>
                                  <Storyboard x:Key="Release">
                                    <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Width"/>
                                    <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight"/>
                                    <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth"/>
                                  </Storyboard>
                                </ControlTemplate.Resources>
                                <Grid x:Name="GridRoot" HorizontalAlignment="Stretch" MinHeight="30" MinWidth="30" Width="Auto" SnapsToDevicePixels="True" Background="Transparent">
                                  <Rectangle x:Name="TrackBkgd" 
                                             Visibility="Collapsed"
                                             Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" RadiusX="4" RadiusY="4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="8" Height="Auto"/>
                                  <Border x:Name="Track" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True" Background="Transparent">
                                    <Grid>
                                      <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="Auto" />
                                      </Grid.RowDefinitions>

                                      <s:SurfaceRepeatButton 
                                        Style="{StaticResource ScrollBarButton}"
                                        Command="ScrollBar.LineUpCommand"
                                        IsEnabled="{Binding VerticalOffset, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}}" 
                                        />

                                      <s:SurfaceTrack x:Name="PART_Track" 
                                                      Grid.Row="1"
                                                      Visibility="Collapsed"
                                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" IsDirectionReversed="True">
                                        <s:SurfaceTrack.Thumb>
                                          <s:SurfaceThumb x:Name="Thumb" MinHeight="8" MinWidth="8" Background="White" SnapsToDevicePixels="True">
                                            <s:SurfaceThumb.BorderBrush>
                                              <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                <GradientStop Color="#66000000" Offset="0"/>
                                                <GradientStop Color="#33000000" Offset="1"/>
                                              </LinearGradientBrush>
                                            </s:SurfaceThumb.BorderBrush>
                                            <s:SurfaceThumb.Style>
                                              <Style TargetType="{x:Type s:SurfaceThumb}">
                                                <Setter Property="Background">
                                                  <Setter.Value>
                                                    <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                      <GradientStop Color="#66000000" Offset="0"/>
                                                      <GradientStop Color="#33000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                  </Setter.Value>
                                                </Setter>
                                                <Setter Property="BorderBrush">
                                                  <Setter.Value>
                                                    <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                      <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                      <GradientStop Color="#19000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                  </Setter.Value>
                                                </Setter>
                                                <Setter Property="Template">
                                                  <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type s:SurfaceThumb}">
                                                      <ControlTemplate.Resources>
                                                        <Storyboard x:Key="Press">
                                                          <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" To="1"/>
                                                          <ThicknessAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" To="-3"/>
                                                        </Storyboard>
                                                        <Storyboard x:Key="Release">
                                                          <DoubleAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" From="1" To="0"/>
                                                          <ThicknessAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" From="-3" To="-1"/>
                                                        </Storyboard>
                                                      </ControlTemplate.Resources>
                                                      <Grid x:Name="Grid" Width="{TemplateBinding MinWidth}" Height="Auto" SnapsToDevicePixels="True" Background="Transparent">
                                                        <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="3" RadiusY="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" SnapsToDevicePixels="True"/>
                                                        <Rectangle x:Name="RenderOverlay" RadiusX="3" RadiusY="3" HorizontalAlignment="Stretch" Margin="1" VerticalAlignment="Stretch" Height="Auto" SnapsToDevicePixels="True">
                                                          <Rectangle.Stroke>
                                                            <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                              <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                              <GradientStop Color="#19000000" Offset="1"/>
                                                            </LinearGradientBrush>
                                                          </Rectangle.Stroke>
                                                          <Rectangle.Fill>
                                                            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                              <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                              <GradientStop Color="#0C000000" Offset="1"/>
                                                            </LinearGradientBrush>
                                                          </Rectangle.Fill>
                                                        </Rectangle>
                                                        <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Margin="-1" IsHitTestVisible="True" Opacity="0" Color="White" CornerRadius="3"/>
                                                      </Grid>
                                                      <ControlTemplate.Triggers>
                                                        <Trigger Property="IsFocused" Value="True"/>
                                                        <Trigger Property="IsDragging" Value="True">
                                                          <Trigger.EnterActions>
                                                            <BeginStoryboard>
                                                              <Storyboard>
                                                                <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" To="1"/>
                                                                <ThicknessAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" To="-3"/>
                                                              </Storyboard>
                                                            </BeginStoryboard>
                                                          </Trigger.EnterActions>
                                                          <Trigger.ExitActions>
                                                            <BeginStoryboard>
                                                              <Storyboard>
                                                                <DoubleAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" From="1" To="0"/>
                                                                <ThicknessAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" From="-3" To="-1"/>
                                                              </Storyboard>
                                                            </BeginStoryboard>
                                                          </Trigger.ExitActions>
                                                        </Trigger>
                                                        <Trigger Property="IsEnabled" Value="False">
                                                          <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                        </Trigger>
                                                      </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                  </Setter.Value>
                                                </Setter>
                                              </Style>
                                            </s:SurfaceThumb.Style>
                                          </s:SurfaceThumb>
                                        </s:SurfaceTrack.Thumb>
                                        <s:SurfaceTrack.IncreaseRepeatButton>
                                          <s:SurfaceRepeatButton Background="Transparent" SnapsToDevicePixels="True" Command="ScrollBar.PageDownCommand">
                                            <s:SurfaceRepeatButton.Style>
                                              <Style TargetType="{x:Type s:SurfaceRepeatButton}">
                                                <Setter Property="Background" Value="{x:Null}"/>
                                                <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                <Setter Property="IsTabStop" Value="False"/>
                                                <Setter Property="Focusable" Value="False"/>
                                                <Setter Property="Interval" Value="300"/>
                                                <Setter Property="Padding" Value="-5"/>
                                                <Setter Property="Template">
                                                  <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type s:SurfaceRepeatButton}">
                                                      <Grid>
                                                        <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Margin="{TemplateBinding Padding}"/>
                                                      </Grid>
                                                    </ControlTemplate>
                                                  </Setter.Value>
                                                </Setter>
                                              </Style>
                                            </s:SurfaceRepeatButton.Style>
                                          </s:SurfaceRepeatButton>
                                        </s:SurfaceTrack.IncreaseRepeatButton>
                                        <s:SurfaceTrack.DecreaseRepeatButton>
                                          <s:SurfaceRepeatButton Background="Transparent" SnapsToDevicePixels="True" Command="ScrollBar.PageUpCommand">
                                            <s:SurfaceRepeatButton.Style>
                                              <Style TargetType="{x:Type s:SurfaceRepeatButton}">
                                                <Setter Property="Background" Value="{x:Null}"/>
                                                <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                <Setter Property="IsTabStop" Value="False"/>
                                                <Setter Property="Focusable" Value="False"/>
                                                <Setter Property="Interval" Value="300"/>
                                                <Setter Property="Padding" Value="-5"/>
                                                <Setter Property="Template">
                                                  <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type s:SurfaceRepeatButton}">
                                                      <Grid>
                                                        <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Margin="{TemplateBinding Padding}"/>
                                                      </Grid>
                                                    </ControlTemplate>
                                                  </Setter.Value>
                                                </Setter>
                                              </Style>
                                            </s:SurfaceRepeatButton.Style>
                                          </s:SurfaceRepeatButton>
                                        </s:SurfaceTrack.DecreaseRepeatButton>
                                      </s:SurfaceTrack>

                                      <s:SurfaceRepeatButton 
                                        Style="{StaticResource ScrollBarButton}"
                                        Command="ScrollBar.LineDownCommand"
                                        Grid.Row="2"
                                        >
                                        <s:SurfaceRepeatButton.IsEnabled>
                                          <MultiBinding Converter="{StaticResource ScrollViewerNotAtEndConverter}">
                                            <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="ViewportHeight" />
                                            <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="VerticalOffset" />
                                            <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="ExtentHeight" />
                                          </MultiBinding>
                                        </s:SurfaceRepeatButton.IsEnabled>

                                      </s:SurfaceRepeatButton>

                                    </Grid>
                                  </Border>
                                </Grid>
                                <ControlTemplate.Triggers>
                                  <Trigger Property="s:Contacts.IsAnyContactOrMouseCapturedWithin" Value="True">
                                    <Trigger.EnterActions>
                                      <BeginStoryboard>
                                        <Storyboard>
                                          <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Width" To="30"/>
                                          <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight" To="12"/>
                                          <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth" To="30"/>
                                        </Storyboard>
                                      </BeginStoryboard>
                                    </Trigger.EnterActions>
                                    <Trigger.ExitActions>
                                      <BeginStoryboard>
                                        <Storyboard>
                                          <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Width"/>
                                          <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight"/>
                                          <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth"/>
                                        </Storyboard>
                                      </BeginStoryboard>
                                    </Trigger.ExitActions>
                                  </Trigger>
                                  <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                    <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                    <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                    <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                  </Trigger>
                                </ControlTemplate.Triggers>
                              </ControlTemplate>
                            </Setter.Value>
                          </Setter>
                          <Style.Triggers>
                            <Trigger Property="Orientation" Value="Horizontal">
                              <Setter Property="Width" Value="NaN"/>
                              <Setter Property="MinWidth" Value="30"/>
                              <Setter Property="Height" Value="30"/>
                              <Setter Property="MinHeight" Value="30"/>
                              <Setter Property="Background">
                                <Setter.Value>
                                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#33364E5C" Offset="0"/>
                                    <GradientStop Color="#0C364E5C" Offset="1"/>
                                  </LinearGradientBrush>
                                </Setter.Value>
                              </Setter>
                              <Setter Property="VerticalAlignment" Value="Stretch"/>
                              <Setter Property="HorizontalAlignment" Value="Stretch"/>
                              <Setter Property="Template">
                                <Setter.Value>
                                  <ControlTemplate TargetType="{x:Type s:SurfaceScrollBar}">
                                    <ControlTemplate.Resources>
                                      <Storyboard x:Key="Touch">
                                        <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Height" To="30"/>
                                        <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight" To="30"/>
                                        <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth" To="12"/>
                                      </Storyboard>
                                      <Storyboard x:Key="Release">
                                        <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Height"/>
                                        <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight"/>
                                        <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth"/>
                                      </Storyboard>
                                    </ControlTemplate.Resources>
                                    <Grid x:Name="GridRoot" MinHeight="30" MinWidth="30" Height="Auto" SnapsToDevicePixels="True" Background="Transparent">
                                      <Rectangle x:Name="TrackBkgd" 
                                                 Visibility="Collapsed"
                                                 Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" RadiusX="4" RadiusY="4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="8"/>
                                      <Border x:Name="Track" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True" Background="Transparent">

                                        <Grid>
                                          <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="Auto" />
                                          </Grid.ColumnDefinitions>

                                          <s:SurfaceRepeatButton 
                                              Style="{StaticResource ScrollBarButton}"
                                              Command="ScrollBar.LineLeftCommand"
                                              IsEnabled="{Binding HorizontalOffset, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}}" 
                                              />

                                          <s:SurfaceTrack x:Name="PART_Track" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                          Grid.Column="1" Visibility="Collapsed" >
                                            <s:SurfaceTrack.Thumb>
                                              <s:SurfaceThumb x:Name="Thumb" MinHeight="8" MinWidth="8" Background="White" SnapsToDevicePixels="True">
                                                <s:SurfaceThumb.BorderBrush>
                                                  <LinearGradientBrush EndPoint="1.007,0.495" StartPoint="-0.007,0.495">
                                                    <GradientStop Color="#66000000" Offset="0"/>
                                                    <GradientStop Color="#33000000" Offset="1"/>
                                                  </LinearGradientBrush>
                                                </s:SurfaceThumb.BorderBrush>
                                                <s:SurfaceThumb.Style>
                                                  <Style TargetType="{x:Type s:SurfaceThumb}">
                                                    <Setter Property="Background">
                                                      <Setter.Value>
                                                        <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                          <GradientStop Color="#66000000" Offset="0"/>
                                                          <GradientStop Color="#33000000" Offset="1"/>
                                                        </LinearGradientBrush>
                                                      </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="BorderBrush">
                                                      <Setter.Value>
                                                        <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                          <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                          <GradientStop Color="#19000000" Offset="1"/>
                                                        </LinearGradientBrush>
                                                      </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="Template">
                                                      <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type s:SurfaceThumb}">
                                                          <ControlTemplate.Resources>
                                                            <Storyboard x:Key="Press">
                                                              <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" To="1"/>
                                                              <ThicknessAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" To="-3"/>
                                                            </Storyboard>
                                                            <Storyboard x:Key="Release">
                                                              <DoubleAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" From="1" To="0"/>
                                                              <ThicknessAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" From="-3" To="-1"/>
                                                            </Storyboard>
                                                          </ControlTemplate.Resources>
                                                          <Grid x:Name="Grid" Width="Auto" Height="{TemplateBinding MinHeight}" SnapsToDevicePixels="True" Background="Transparent">
                                                            <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="3" RadiusY="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" SnapsToDevicePixels="True"/>
                                                            <Rectangle x:Name="RenderOverlay" RadiusX="3" RadiusY="3" HorizontalAlignment="Stretch" Margin="1" VerticalAlignment="Stretch" Width="Auto" SnapsToDevicePixels="True">
                                                              <Rectangle.Stroke>
                                                                <LinearGradientBrush EndPoint="0.563,1.015" StartPoint="0.563,-0.026">
                                                                  <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                  <GradientStop Color="#19000000" Offset="1"/>
                                                                </LinearGradientBrush>
                                                              </Rectangle.Stroke>
                                                              <Rectangle.Fill>
                                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                  <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                  <GradientStop Color="#0C000000" Offset="1"/>
                                                                </LinearGradientBrush>
                                                              </Rectangle.Fill>
                                                            </Rectangle>
                                                            <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Margin="-1" IsHitTestVisible="True" Opacity="0" Color="White" CornerRadius="3"/>
                                                          </Grid>
                                                          <ControlTemplate.Triggers>
                                                            <Trigger Property="IsFocused" Value="True"/>
                                                            <Trigger Property="IsDragging" Value="True">
                                                              <Trigger.EnterActions>
                                                                <BeginStoryboard>
                                                                  <Storyboard>
                                                                    <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" To="1"/>
                                                                    <ThicknessAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" To="-3"/>
                                                                  </Storyboard>
                                                                </BeginStoryboard>
                                                              </Trigger.EnterActions>
                                                              <Trigger.ExitActions>
                                                                <BeginStoryboard>
                                                                  <Storyboard>
                                                                    <DoubleAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" From="1" To="0"/>
                                                                    <ThicknessAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" From="-3" To="-1"/>
                                                                  </Storyboard>
                                                                </BeginStoryboard>
                                                              </Trigger.ExitActions>
                                                            </Trigger>
                                                            <Trigger Property="IsEnabled" Value="False">
                                                              <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                            </Trigger>
                                                          </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                      </Setter.Value>
                                                    </Setter>
                                                  </Style>
                                                </s:SurfaceThumb.Style>
                                              </s:SurfaceThumb>
                                            </s:SurfaceTrack.Thumb>
                                            <s:SurfaceTrack.IncreaseRepeatButton>
                                              <s:SurfaceRepeatButton Background="Transparent" SnapsToDevicePixels="True" Command="ScrollBar.PageRightCommand">
                                                <s:SurfaceRepeatButton.Style>
                                                  <Style TargetType="{x:Type s:SurfaceRepeatButton}">
                                                    <Setter Property="Background" Value="{x:Null}"/>
                                                    <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                    <Setter Property="IsTabStop" Value="False"/>
                                                    <Setter Property="Focusable" Value="False"/>
                                                    <Setter Property="Interval" Value="300"/>
                                                    <Setter Property="Padding" Value="-5"/>
                                                    <Setter Property="Template">
                                                      <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type s:SurfaceRepeatButton}">
                                                          <Grid>
                                                            <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Margin="{TemplateBinding Padding}"/>
                                                          </Grid>
                                                        </ControlTemplate>
                                                      </Setter.Value>
                                                    </Setter>
                                                  </Style>
                                                </s:SurfaceRepeatButton.Style>
                                              </s:SurfaceRepeatButton>
                                            </s:SurfaceTrack.IncreaseRepeatButton>
                                            <s:SurfaceTrack.DecreaseRepeatButton>
                                              <s:SurfaceRepeatButton Background="Transparent" SnapsToDevicePixels="True" Command="ScrollBar.PageLeftCommand">
                                                <s:SurfaceRepeatButton.Style>
                                                  <Style TargetType="{x:Type s:SurfaceRepeatButton}">
                                                    <Setter Property="Background" Value="{x:Null}"/>
                                                    <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                    <Setter Property="IsTabStop" Value="False"/>
                                                    <Setter Property="Focusable" Value="False"/>
                                                    <Setter Property="Interval" Value="300"/>
                                                    <Setter Property="Padding" Value="-5"/>
                                                    <Setter Property="Template">
                                                      <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type s:SurfaceRepeatButton}">
                                                          <Grid>
                                                            <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Margin="{TemplateBinding Padding}"/>
                                                          </Grid>
                                                        </ControlTemplate>
                                                      </Setter.Value>
                                                    </Setter>
                                                  </Style>
                                                </s:SurfaceRepeatButton.Style>
                                              </s:SurfaceRepeatButton>
                                            </s:SurfaceTrack.DecreaseRepeatButton>
                                          </s:SurfaceTrack>

                                          <s:SurfaceRepeatButton 
                                            Style="{StaticResource ScrollBarButton}"
                                            Command="ScrollBar.LineRightCommand"
                                            Grid.Column="2"
                                            >
                                            <s:SurfaceRepeatButton.IsEnabled>
                                              <MultiBinding Converter="{StaticResource ScrollViewerNotAtEndConverter}">
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="ViewportWidth" />
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="HorizontalOffset" />
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="ExtentWidth" />
                                              </MultiBinding>
                                            </s:SurfaceRepeatButton.IsEnabled>

                                          </s:SurfaceRepeatButton>

                                        </Grid>

                                      </Border>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                      <Trigger Property="s:Contacts.IsAnyContactOrMouseCapturedWithin" Value="True">
                                        <Trigger.EnterActions>
                                          <BeginStoryboard>
                                            <Storyboard>
                                              <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Height" To="30"/>
                                              <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight" To="30"/>
                                              <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth" To="12"/>
                                            </Storyboard>
                                          </BeginStoryboard>
                                        </Trigger.EnterActions>
                                        <Trigger.ExitActions>
                                          <BeginStoryboard>
                                            <Storyboard>
                                              <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Height"/>
                                              <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight"/>
                                              <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth"/>
                                            </Storyboard>
                                          </BeginStoryboard>
                                        </Trigger.ExitActions>
                                      </Trigger>
                                      <Trigger Property="IsEnabled" Value="False">
                                        <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                        <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                        <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                        <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                      </Trigger>
                                    </ControlTemplate.Triggers>
                                  </ControlTemplate>
                                </Setter.Value>
                              </Setter>
                            </Trigger>
                          </Style.Triggers>
                        </Style>
                      </s:SurfaceScrollBar.Style>
                    </s:SurfaceScrollBar>

                    <s:SurfaceScrollBar x:Name="PART_VerticalScrollBar" HorizontalAlignment="Center" MinHeight="30" MinWidth="30" Width="Auto" 
                                        Foreground="{x:Null}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" 
                                        IsEnabled="True" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"  
                                        Grid.Row="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
                                        AutomationProperties.AutomationId="VerticalScrollBar" Orientation="Vertical" 
                                        ViewportSize="{TemplateBinding ViewportHeight}" LargeChange="1" Maximum="{TemplateBinding ScrollableHeight}"
                                        Minimum="0" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}">
                      <s:SurfaceScrollBar.Style>
                        <Style TargetType="{x:Type s:SurfaceScrollBar}">
                          <Style.Resources>
                            <System:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}">52</System:Double>
                            <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">52</System:Double>
                          </Style.Resources>
                          <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
                          <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
                          <Setter Property="BorderBrush" Value="#33000000"/>
                          <Setter Property="Background">
                            <Setter.Value>
                              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                <GradientStop Color="#33364E5C" Offset="0"/>
                                <GradientStop Color="#0C364E5C" Offset="1"/>
                              </LinearGradientBrush>
                            </Setter.Value>
                          </Setter>
                          <Setter Property="Width" Value="30"/>
                          <Setter Property="MinWidth" Value="30"/>
                          <Setter Property="Height" Value="NaN"/>
                          <Setter Property="MinHeight" Value="30"/>
                          <Setter Property="VerticalAlignment" Value="Stretch"/>
                          <Setter Property="HorizontalAlignment" Value="Stretch"/>
                          <Setter Property="Template">
                            <Setter.Value>
                              <ControlTemplate TargetType="{x:Type s:SurfaceScrollBar}">
                                <ControlTemplate.Resources>
                                  <Storyboard x:Key="Touch">
                                    <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Width" To="30"/>
                                    <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight" To="12"/>
                                    <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth" To="30"/>
                                  </Storyboard>
                                  <Storyboard x:Key="Release">
                                    <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Width"/>
                                    <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight"/>
                                    <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth"/>
                                  </Storyboard>
                                </ControlTemplate.Resources>
                                <Grid x:Name="GridRoot" HorizontalAlignment="Stretch" MinHeight="30" MinWidth="30" Width="Auto" SnapsToDevicePixels="True" Background="Transparent">
                                  <Rectangle x:Name="TrackBkgd" 
                                             Visibility="Collapsed"
                                             Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" RadiusX="4" RadiusY="4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="8" Height="Auto"/>
                                  <Border x:Name="Track" HorizontalAlignment="Stretch" Opacity="1" SnapsToDevicePixels="True" Background="Transparent">

                                    <Grid>
                                      <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="Auto" />
                                      </Grid.RowDefinitions>

                                      <s:SurfaceRepeatButton 
                                        Style="{StaticResource ScrollBarButton}"
                                        Command="ScrollBar.LineUpCommand"
                                        IsEnabled="{Binding VerticalOffset, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}}" 
                                        />

                                      <s:SurfaceTrack x:Name="PART_Track" 
                                                      Visibility="Collapsed"
                                                      Grid.Row="1"
                                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" IsDirectionReversed="True">
                                        <s:SurfaceTrack.Thumb>
                                          <s:SurfaceThumb x:Name="Thumb" MinHeight="8" MinWidth="8" Background="White" SnapsToDevicePixels="True">
                                            <s:SurfaceThumb.BorderBrush>
                                              <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                <GradientStop Color="#66000000" Offset="0"/>
                                                <GradientStop Color="#33000000" Offset="1"/>
                                              </LinearGradientBrush>
                                            </s:SurfaceThumb.BorderBrush>
                                            <s:SurfaceThumb.Style>
                                              <Style TargetType="{x:Type s:SurfaceThumb}">
                                                <Setter Property="Background">
                                                  <Setter.Value>
                                                    <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                      <GradientStop Color="#66000000" Offset="0"/>
                                                      <GradientStop Color="#33000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                  </Setter.Value>
                                                </Setter>
                                                <Setter Property="BorderBrush">
                                                  <Setter.Value>
                                                    <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                      <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                      <GradientStop Color="#19000000" Offset="1"/>
                                                    </LinearGradientBrush>
                                                  </Setter.Value>
                                                </Setter>
                                                <Setter Property="Template">
                                                  <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type s:SurfaceThumb}">
                                                      <ControlTemplate.Resources>
                                                        <Storyboard x:Key="Press">
                                                          <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" To="1"/>
                                                          <ThicknessAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" To="-3"/>
                                                        </Storyboard>
                                                        <Storyboard x:Key="Release">
                                                          <DoubleAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" From="1" To="0"/>
                                                          <ThicknessAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" From="-3" To="-1"/>
                                                        </Storyboard>
                                                      </ControlTemplate.Resources>
                                                      <Grid x:Name="Grid" Width="{TemplateBinding MinWidth}" Height="Auto" SnapsToDevicePixels="True" Background="Transparent">
                                                        <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="3" RadiusY="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" SnapsToDevicePixels="True"/>
                                                        <Rectangle x:Name="RenderOverlay" RadiusX="3" RadiusY="3" HorizontalAlignment="Stretch" Margin="1" VerticalAlignment="Stretch" Height="Auto" SnapsToDevicePixels="True">
                                                          <Rectangle.Stroke>
                                                            <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                              <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                              <GradientStop Color="#19000000" Offset="1"/>
                                                            </LinearGradientBrush>
                                                          </Rectangle.Stroke>
                                                          <Rectangle.Fill>
                                                            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                              <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                              <GradientStop Color="#0C000000" Offset="1"/>
                                                            </LinearGradientBrush>
                                                          </Rectangle.Fill>
                                                        </Rectangle>
                                                        <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Margin="-1" IsHitTestVisible="True" Opacity="0" Color="White" CornerRadius="3"/>
                                                      </Grid>
                                                      <ControlTemplate.Triggers>
                                                        <Trigger Property="IsFocused" Value="True"/>
                                                        <Trigger Property="IsDragging" Value="True">
                                                          <Trigger.EnterActions>
                                                            <BeginStoryboard>
                                                              <Storyboard>
                                                                <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" To="1"/>
                                                                <ThicknessAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" To="-3"/>
                                                              </Storyboard>
                                                            </BeginStoryboard>
                                                          </Trigger.EnterActions>
                                                          <Trigger.ExitActions>
                                                            <BeginStoryboard>
                                                              <Storyboard>
                                                                <DoubleAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" From="1" To="0"/>
                                                                <ThicknessAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" From="-3" To="-1"/>
                                                              </Storyboard>
                                                            </BeginStoryboard>
                                                          </Trigger.ExitActions>
                                                        </Trigger>
                                                        <Trigger Property="IsEnabled" Value="False">
                                                          <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                        </Trigger>
                                                      </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                  </Setter.Value>
                                                </Setter>
                                              </Style>
                                            </s:SurfaceThumb.Style>
                                          </s:SurfaceThumb>
                                        </s:SurfaceTrack.Thumb>
                                        <s:SurfaceTrack.IncreaseRepeatButton>
                                          <s:SurfaceRepeatButton Background="Transparent" SnapsToDevicePixels="True" Command="ScrollBar.PageDownCommand">
                                            <s:SurfaceRepeatButton.Style>
                                              <Style TargetType="{x:Type s:SurfaceRepeatButton}">
                                                <Setter Property="Background" Value="{x:Null}"/>
                                                <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                <Setter Property="IsTabStop" Value="False"/>
                                                <Setter Property="Focusable" Value="False"/>
                                                <Setter Property="Interval" Value="300"/>
                                                <Setter Property="Padding" Value="-5"/>
                                                <Setter Property="Template">
                                                  <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type s:SurfaceRepeatButton}">
                                                      <Grid>
                                                        <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Margin="{TemplateBinding Padding}"/>
                                                      </Grid>
                                                    </ControlTemplate>
                                                  </Setter.Value>
                                                </Setter>
                                              </Style>
                                            </s:SurfaceRepeatButton.Style>
                                          </s:SurfaceRepeatButton>
                                        </s:SurfaceTrack.IncreaseRepeatButton>
                                        <s:SurfaceTrack.DecreaseRepeatButton>
                                          <s:SurfaceRepeatButton Background="Transparent" SnapsToDevicePixels="True" Command="ScrollBar.PageUpCommand">
                                            <s:SurfaceRepeatButton.Style>
                                              <Style TargetType="{x:Type s:SurfaceRepeatButton}">
                                                <Setter Property="Background" Value="{x:Null}"/>
                                                <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                <Setter Property="IsTabStop" Value="False"/>
                                                <Setter Property="Focusable" Value="False"/>
                                                <Setter Property="Interval" Value="300"/>
                                                <Setter Property="Padding" Value="-5"/>
                                                <Setter Property="Template">
                                                  <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type s:SurfaceRepeatButton}">
                                                      <Grid>
                                                        <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Margin="{TemplateBinding Padding}"/>
                                                      </Grid>
                                                    </ControlTemplate>
                                                  </Setter.Value>
                                                </Setter>
                                              </Style>
                                            </s:SurfaceRepeatButton.Style>
                                          </s:SurfaceRepeatButton>
                                        </s:SurfaceTrack.DecreaseRepeatButton>
                                      </s:SurfaceTrack>

                                      <s:SurfaceRepeatButton 
                                        Style="{StaticResource ScrollBarButton}"
                                        Command="ScrollBar.LineDownCommand"
                                        Grid.Row="2"
                                        >
                                        <s:SurfaceRepeatButton.IsEnabled>
                                          <MultiBinding Converter="{StaticResource ScrollViewerNotAtEndConverter}">
                                            <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="ViewportHeight" />
                                            <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="VerticalOffset" />
                                            <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="ExtentHeight" />
                                          </MultiBinding>
                                        </s:SurfaceRepeatButton.IsEnabled>

                                      </s:SurfaceRepeatButton>
                                    </Grid>

                                  </Border>
                                </Grid>
                                <ControlTemplate.Triggers>
                                  <Trigger Property="s:Contacts.IsAnyContactOrMouseCapturedWithin" Value="True">
                                    <Trigger.EnterActions>
                                      <BeginStoryboard>
                                        <Storyboard>
                                          <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Width" To="30"/>
                                          <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight" To="12"/>
                                          <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth" To="30"/>
                                        </Storyboard>
                                      </BeginStoryboard>
                                    </Trigger.EnterActions>
                                    <Trigger.ExitActions>
                                      <BeginStoryboard>
                                        <Storyboard>
                                          <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Width"/>
                                          <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight"/>
                                          <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth"/>
                                        </Storyboard>
                                      </BeginStoryboard>
                                    </Trigger.ExitActions>
                                  </Trigger>
                                  <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                    <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                    <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                    <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                  </Trigger>
                                </ControlTemplate.Triggers>
                              </ControlTemplate>
                            </Setter.Value>
                          </Setter>
                          <Style.Triggers>
                            <Trigger Property="Orientation" Value="Horizontal">
                              <Setter Property="Width" Value="NaN"/>
                              <Setter Property="MinWidth" Value="30"/>
                              <Setter Property="Height" Value="30"/>
                              <Setter Property="MinHeight" Value="30"/>
                              <Setter Property="Background">
                                <Setter.Value>
                                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#33364E5C" Offset="0"/>
                                    <GradientStop Color="#0C364E5C" Offset="1"/>
                                  </LinearGradientBrush>
                                </Setter.Value>
                              </Setter>
                              <Setter Property="VerticalAlignment" Value="Stretch"/>
                              <Setter Property="HorizontalAlignment" Value="Stretch"/>
                              <Setter Property="Template">
                                <Setter.Value>
                                  <ControlTemplate TargetType="{x:Type s:SurfaceScrollBar}">
                                    <ControlTemplate.Resources>
                                      <Storyboard x:Key="Touch">
                                        <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Height" To="30"/>
                                        <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight" To="30"/>
                                        <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth" To="12"/>
                                      </Storyboard>
                                      <Storyboard x:Key="Release">
                                        <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Height"/>
                                        <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight"/>
                                        <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth"/>
                                      </Storyboard>
                                    </ControlTemplate.Resources>
                                    <Grid x:Name="GridRoot" MinHeight="30" MinWidth="30" Height="Auto" SnapsToDevicePixels="True" Background="Transparent">

                                      <Rectangle x:Name="TrackBkgd" 
                                                 Visibility="Collapsed"
                                                 Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}"
                                                 RadiusX="4" RadiusY="4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" 
                                                 Height="8"/>

                                      <Border x:Name="Track" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="1" 
                                              SnapsToDevicePixels="True" Background="Transparent">

                                        <Grid>
                                          <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="Auto" />
                                          </Grid.ColumnDefinitions>

                                          <s:SurfaceRepeatButton 
                                              Style="{StaticResource ScrollBarButton}"
                                              Command="ScrollBar.LineLeftCommand"
                                              IsEnabled="{Binding HorizontalOffset, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}}" 
                                              />

                                          <s:SurfaceTrack x:Name="PART_Track" 
                                                          Grid.Column="1" Visibility="Hidden"
                                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                            <s:SurfaceTrack.Thumb>
                                              <s:SurfaceThumb x:Name="Thumb" MinHeight="8" MinWidth="8" Background="White" SnapsToDevicePixels="True">
                                                <s:SurfaceThumb.BorderBrush>
                                                  <LinearGradientBrush EndPoint="1.007,0.495" StartPoint="-0.007,0.495">
                                                    <GradientStop Color="#66000000" Offset="0"/>
                                                    <GradientStop Color="#33000000" Offset="1"/>
                                                  </LinearGradientBrush>
                                                </s:SurfaceThumb.BorderBrush>
                                                <s:SurfaceThumb.Style>
                                                  <Style TargetType="{x:Type s:SurfaceThumb}">
                                                    <Setter Property="Background">
                                                      <Setter.Value>
                                                        <LinearGradientBrush EndPoint="0.5,-0.012" StartPoint="0.5,1.002">
                                                          <GradientStop Color="#66000000" Offset="0"/>
                                                          <GradientStop Color="#33000000" Offset="1"/>
                                                        </LinearGradientBrush>
                                                      </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="BorderBrush">
                                                      <Setter.Value>
                                                        <LinearGradientBrush EndPoint="1.083,0.495" StartPoint="0.042,0.495">
                                                          <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                          <GradientStop Color="#19000000" Offset="1"/>
                                                        </LinearGradientBrush>
                                                      </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="Template">
                                                      <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type s:SurfaceThumb}">
                                                          <ControlTemplate.Resources>
                                                            <Storyboard x:Key="Press">
                                                              <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" To="1"/>
                                                              <ThicknessAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" To="-3"/>
                                                            </Storyboard>
                                                            <Storyboard x:Key="Release">
                                                              <DoubleAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" From="1" To="0"/>
                                                              <ThicknessAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" From="-3" To="-1"/>
                                                            </Storyboard>
                                                          </ControlTemplate.Resources>
                                                          <Grid x:Name="Grid" Width="Auto" Height="{TemplateBinding MinHeight}" SnapsToDevicePixels="True" Background="Transparent">
                                                            <Rectangle x:Name="Base" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="3" RadiusY="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" SnapsToDevicePixels="True"/>
                                                            <Rectangle x:Name="RenderOverlay" RadiusX="3" RadiusY="3" HorizontalAlignment="Stretch" Margin="1" VerticalAlignment="Stretch" Width="Auto" SnapsToDevicePixels="True">
                                                              <Rectangle.Stroke>
                                                                <LinearGradientBrush EndPoint="0.563,1.015" StartPoint="0.563,-0.026">
                                                                  <GradientStop Color="#7FFFFFFF" Offset="0"/>
                                                                  <GradientStop Color="#19000000" Offset="1"/>
                                                                </LinearGradientBrush>
                                                              </Rectangle.Stroke>
                                                              <Rectangle.Fill>
                                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                  <GradientStop Color="#4CFFFFFF" Offset="0"/>
                                                                  <GradientStop Color="#0C000000" Offset="1"/>
                                                                </LinearGradientBrush>
                                                              </Rectangle.Fill>
                                                            </Rectangle>
                                                            <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Margin="-1" IsHitTestVisible="True" Opacity="0" Color="White" CornerRadius="3"/>
                                                          </Grid>
                                                          <ControlTemplate.Triggers>
                                                            <Trigger Property="IsFocused" Value="True"/>
                                                            <Trigger Property="IsDragging" Value="True">
                                                              <Trigger.EnterActions>
                                                                <BeginStoryboard>
                                                                  <Storyboard>
                                                                    <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" To="1"/>
                                                                    <ThicknessAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" To="-3"/>
                                                                  </Storyboard>
                                                                </BeginStoryboard>
                                                              </Trigger.EnterActions>
                                                              <Trigger.ExitActions>
                                                                <BeginStoryboard>
                                                                  <Storyboard>
                                                                    <DoubleAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Opacity" From="1" To="0"/>
                                                                    <ThicknessAnimation Duration="00:00:00.1500000" Storyboard.TargetName="Glow" Storyboard.TargetProperty="Margin" From="-3" To="-1"/>
                                                                  </Storyboard>
                                                                </BeginStoryboard>
                                                              </Trigger.ExitActions>
                                                            </Trigger>
                                                            <Trigger Property="IsEnabled" Value="False">
                                                              <Setter Property="Fill" TargetName="RenderOverlay" Value="#1C000000"/>
                                                            </Trigger>
                                                          </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                      </Setter.Value>
                                                    </Setter>
                                                  </Style>
                                                </s:SurfaceThumb.Style>
                                              </s:SurfaceThumb>
                                            </s:SurfaceTrack.Thumb>
                                            <s:SurfaceTrack.IncreaseRepeatButton>
                                              <s:SurfaceRepeatButton Background="Transparent" SnapsToDevicePixels="True" Command="ScrollBar.PageRightCommand">
                                                <s:SurfaceRepeatButton.Style>
                                                  <Style TargetType="{x:Type s:SurfaceRepeatButton}">
                                                    <Setter Property="Background" Value="{x:Null}"/>
                                                    <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                    <Setter Property="IsTabStop" Value="False"/>
                                                    <Setter Property="Focusable" Value="False"/>
                                                    <Setter Property="Interval" Value="300"/>
                                                    <Setter Property="Padding" Value="-5"/>
                                                    <Setter Property="Template">
                                                      <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type s:SurfaceRepeatButton}">
                                                          <Grid>
                                                            <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Margin="{TemplateBinding Padding}"/>
                                                          </Grid>
                                                        </ControlTemplate>
                                                      </Setter.Value>
                                                    </Setter>
                                                  </Style>
                                                </s:SurfaceRepeatButton.Style>
                                              </s:SurfaceRepeatButton>
                                            </s:SurfaceTrack.IncreaseRepeatButton>
                                            <s:SurfaceTrack.DecreaseRepeatButton>
                                              <s:SurfaceRepeatButton Background="Transparent" SnapsToDevicePixels="True" Command="ScrollBar.PageLeftCommand">
                                                <s:SurfaceRepeatButton.Style>
                                                  <Style TargetType="{x:Type s:SurfaceRepeatButton}">
                                                    <Setter Property="Background" Value="{x:Null}"/>
                                                    <Setter Property="BorderBrush" Value="{x:Null}"/>
                                                    <Setter Property="IsTabStop" Value="False"/>
                                                    <Setter Property="Focusable" Value="False"/>
                                                    <Setter Property="Interval" Value="300"/>
                                                    <Setter Property="Padding" Value="-5"/>
                                                    <Setter Property="Template">
                                                      <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type s:SurfaceRepeatButton}">
                                                          <Grid>
                                                            <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Margin="{TemplateBinding Padding}"/>
                                                          </Grid>
                                                        </ControlTemplate>
                                                      </Setter.Value>
                                                    </Setter>
                                                  </Style>
                                                </s:SurfaceRepeatButton.Style>
                                              </s:SurfaceRepeatButton>
                                            </s:SurfaceTrack.DecreaseRepeatButton>
                                          </s:SurfaceTrack>

                                          <s:SurfaceRepeatButton 
                                            Style="{StaticResource ScrollBarButton}"
                                            Command="ScrollBar.LineRightCommand"
                                            Grid.Row="2"
                                            >
                                            <s:SurfaceRepeatButton.IsEnabled>
                                              <MultiBinding Converter="{StaticResource ScrollViewerNotAtEndConverter}">
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="ViewportWidth" />
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="HorizontalOffset" />
                                                <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type s:SurfaceScrollViewer}}" Path="ExtentWidth" />
                                              </MultiBinding>
                                            </s:SurfaceRepeatButton.IsEnabled>

                                          </s:SurfaceRepeatButton>

                                        </Grid>
                                      </Border>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                      <Trigger Property="s:Contacts.IsAnyContactOrMouseCapturedWithin" Value="True">
                                        <Trigger.EnterActions>
                                          <BeginStoryboard>
                                            <Storyboard>
                                              <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Height" To="30"/>
                                              <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight" To="30"/>
                                              <DoubleAnimation Duration="00:00:00.1000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth" To="12"/>
                                            </Storyboard>
                                          </BeginStoryboard>
                                        </Trigger.EnterActions>
                                        <Trigger.ExitActions>
                                          <BeginStoryboard>
                                            <Storyboard>
                                              <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="TrackBkgd" Storyboard.TargetProperty="Height"/>
                                              <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinHeight"/>
                                              <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Thumb" Storyboard.TargetProperty="MinWidth"/>
                                            </Storyboard>
                                          </BeginStoryboard>
                                        </Trigger.ExitActions>
                                      </Trigger>
                                      <Trigger Property="IsEnabled" Value="False">
                                        <Setter Property="Background" TargetName="Thumb" Value="#0CFFFFFF"/>
                                        <Setter Property="Fill" TargetName="TrackBkgd" Value="#00000000"/>
                                        <Setter Property="Opacity" TargetName="GridRoot" Value="0.5"/>
                                        <Setter Property="IsEnabled" TargetName="PART_Track" Value="False"/>
                                      </Trigger>
                                    </ControlTemplate.Triggers>
                                  </ControlTemplate>
                                </Setter.Value>
                              </Setter>
                            </Trigger>
                          </Style.Triggers>
                        </Style>
                      </s:SurfaceScrollBar.Style>
                    </s:SurfaceScrollBar>

                    <Border x:Name="PART_ElasticBorder" Background="{TemplateBinding Background}">
                      <ScrollContentPresenter x:Name="scp" OpacityMask="{x:Null}" 
                                              ScrollViewer.HorizontalScrollBarVisibility="Disabled" Content="{TemplateBinding Content}" 
                                              ContentTemplate="{TemplateBinding ContentTemplate}" 
                                              CanContentScroll="{TemplateBinding CanContentScroll}" 
                                              CanHorizontallyScroll="False" CanVerticallyScroll="False" AllowDrop="False" 
                                              RenderTransformOrigin="0.5,0.5"/>
                    </Border>

                  </Grid>
                  <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                      <Setter Property="IsEnabled" TargetName="PART_HorizontalScrollBar" Value="False" />
                      <Setter Property="IsEnabled" TargetName="PART_VerticalScrollBar" Value="False" />
                    </Trigger>

                    <MultiTrigger>
                      <MultiTrigger.Conditions>
                        <Condition Property="ComputedVerticalScrollBarVisibility" Value="Visible" />
                        <Condition Property="ComputedHorizontalScrollBarVisibility" Value="Visible" />
                      </MultiTrigger.Conditions>
                      <Setter TargetName="scp" Property="Margin" Value="35,35" />
                    </MultiTrigger>

                    <MultiTrigger>
                      <MultiTrigger.Conditions>
                        <Condition Property="ComputedVerticalScrollBarVisibility" Value="Visible" />
                        <Condition Property="ComputedHorizontalScrollBarVisibility" Value="Collapsed" />
                      </MultiTrigger.Conditions>
                      <Setter TargetName="scp" Property="Margin" Value="0,35" />
                    </MultiTrigger>

                    <MultiTrigger>
                      <MultiTrigger.Conditions>
                        <Condition Property="ComputedVerticalScrollBarVisibility" Value="Collapsed" />
                        <Condition Property="ComputedHorizontalScrollBarVisibility" Value="Visible" />
                      </MultiTrigger.Conditions>
                      <Setter TargetName="scp" Property="Margin" Value="35,0" />
                    </MultiTrigger>


                  </ControlTemplate.Triggers>
                </ControlTemplate>
              </Setter.Value>
            </Setter>
          </Style>
        </Style.BasedOn>
      </Style>

    </Style.Resources>

    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="VerticalContentAlignment" Value="Center" />

    <Setter Property="Template">
      <Setter.Value>

        <ControlTemplate TargetType="{x:Type local:Book}">

          <Grid x:Name="PART_Root">

            <Grid.RenderTransform>
              <TransformGroup>
                <ScaleTransform x:Name="PART_Scale" ScaleX="1" ScaleY="1" />
                <RotateTransform Angle="0" />
                <TranslateTransform x:Name="PART_Translate" X="0" Y="0" />
              </TransformGroup>
            </Grid.RenderTransform>

            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition Height="*" />
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width=".1*" />
              <ColumnDefinition Width=".1*" />
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <s:SurfaceScrollViewer Style="{StaticResource BookmarksPanelScrollViewerStyle}"  x:Name="BookmarksScrollViewer" 
                                   Grid.Column="2" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Visible"
                                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                   >
              <StackPanel x:Name="BookmarksPanel" IsItemsHost="True" Orientation="Horizontal" />
            </s:SurfaceScrollViewer>

            <ContentPresenter x:Name="PART_SheetLeft" Grid.Row="1" Grid.Column="2" ContentSource="SheetLeft" />
            <ContentPresenter x:Name="PART_SheetRight" Grid.Row="1" Grid.Column="3" ContentSource="SheetRight" />

            <Grid Visibility="{TemplateBinding BookmarksVisibility}" Grid.Column="5" Grid.Row="1">
              <ContentControl x:Name="PART_Bookmarker" 
                            Margin="20" 
                            Style="{TemplateBinding BookmarkerStyle}" 
                            >
                <ContentControl.Template>
                  <ControlTemplate>

                    <Grid>
                      <Path Stretch="Fill" Data="F1 M 314.855,392.842L 321.182,392.637L 320.294,363.579C 320.294,363.579 320.801,329.776 285.505,330.855C 285.505,330.855 236.994,330.409 228.804,328.767C 228.804,328.767 232.919,335.179 233.799,363.955C 233.799,363.955 233.303,395.203 271.82,394.025L 314.855,392.842 Z " Margin="0.138,0.1,0,0" VerticalAlignment="Top" Height="65.291" HorizontalAlignment="Left" Width="92.378">
                        <Path.Fill>
                          <LinearGradientBrush StartPoint="1.21447,1.29101" EndPoint="3.36707,1.29101">
                            <LinearGradientBrush.RelativeTransform>
                              <TransformGroup>
                                <SkewTransform CenterX="1.21447" CenterY="1.29101" AngleX="19.1403" AngleY="0"/>
                                <RotateTransform CenterX="1.21447" CenterY="1.29101" Angle="229.194"/>
                              </TransformGroup>
                            </LinearGradientBrush.RelativeTransform>
                            <GradientStop Color="#FF000000" Offset="0"/>
                            <GradientStop Color="#FFFFFFFF" Offset="1"/>
                          </LinearGradientBrush>
                        </Path.Fill>
                      </Path>
                      <Viewbox HorizontalAlignment="Left" Margin="49.456,63.415,0,0" Width="24.966" VerticalAlignment="Top">
                        <Canvas Width="24.9663" Height="251.599">
                          <Path Width="13.0455" Height="250.671" Canvas.Left="2.80875" Canvas.Top="0" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF5D5D5D" Data="F1 M 3.30875,0.5C 3.30875,0.5 10.5361,53.0623 7.90793,91.1699C 7.90793,91.1699 3.96579,149.645 11.8501,179.212C 11.8501,179.212 19.7344,211.406 11.8501,250.171"/>
                          <Path Width="12.1971" Height="17.9083" Canvas.Left="8.8919" Canvas.Top="207.431" Stretch="Fill" Data="F1 M 14.2464,224.515L 14.8294,225.34L 18.6202,222.669C 18.6202,222.669 23.1652,219.768 19.9218,215.164C 19.9217,215.164 15.7207,208.666 15.2201,207.431C 15.2201,207.431 14.7278,208.542 10.9739,211.186C 10.9739,211.186 6.77002,213.865 10.3094,218.889L 14.2464,224.515 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.188998,0.418288" EndPoint="1.20706,0.418288">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.188998" CenterY="0.418288" AngleX="-7.54864" AngleY="0"/>
                                    <RotateTransform CenterX="-0.188998" CenterY="0.418288" Angle="6.736"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="8.67182" Height="12.934" Canvas.Left="9.9285" Canvas.Top="227.148" Stretch="Fill" Data="F1 M 13.3445,239.457L 13.7256,240.082L 16.5987,238.337C 16.5987,238.337 20.0286,236.462 17.9087,232.972C 17.9087,232.972 15.1892,228.066 14.8878,227.148C 14.8878,227.148 14.4771,227.927 11.632,229.656C 11.632,229.656 8.45975,231.387 10.7731,235.195L 13.3445,239.457 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.190651,0.386129" EndPoint="1.22177,0.386129">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.190651" CenterY="0.386129" AngleX="-10.714" AngleY="0"/>
                                    <RotateTransform CenterX="-0.190651" CenterY="0.386129" Angle="9.29799"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="6.22138" Height="9.27924" Canvas.Left="9.67074" Canvas.Top="242.319" Stretch="Fill" Data="F1 M 12.1214,251.15L 12.3949,251.599L 14.4561,250.347C 14.4561,250.347 16.9168,249.001 15.3959,246.498C 15.3959,246.498 13.4449,242.978 13.2286,242.319C 13.2286,242.319 12.934,242.879 10.8929,244.119C 10.8929,244.119 8.61703,245.36 10.2767,248.092L 12.1214,251.15 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.190648,0.386132" EndPoint="1.22177,0.386132">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.190648" CenterY="0.386132" AngleX="-10.7138" AngleY="0"/>
                                    <RotateTransform CenterX="-0.190648" CenterY="0.386132" Angle="9.29798"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="16.5937" Height="23.3729" Canvas.Left="5.48095" Canvas.Top="180.485" Stretch="Fill" Data="F1 M 14.2225,202.891L 15.1306,203.858L 19.5787,199.696C 19.5787,199.696 24.9663,195.096 19.9107,189.694C 19.9107,189.694 13.2656,182.001 12.3902,180.485C 12.3902,180.485 11.9511,182.02 7.5463,186.142C 7.5463,186.142 2.56216,190.389 8.07913,196.285L 14.2225,202.891 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.178714,0.484032" EndPoint="1.17974,0.484032">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.178714" CenterY="0.484032" AngleX="-1.32682" AngleY="0"/>
                                    <RotateTransform CenterX="-0.178714" CenterY="0.484032" Angle="1.34989"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="14.0578" Height="19.4767" Canvas.Left="2.58688" Canvas.Top="156.746" Stretch="Fill" Data="F1 M 10.3841,175.447L 11.1822,176.223L 14.7486,172.564C 14.7485,172.564 19.0853,168.503 14.6416,164.171C 14.6416,164.171 8.77802,157.982 7.9863,156.746C 7.9863,156.746 7.67752,158.049 4.14578,161.671C 4.14578,161.671 0.133514,165.422 4.98273,170.149L 10.3841,175.447 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.173449,0.506172" EndPoint="1.17173,0.506172">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.173449" CenterY="0.506172" AngleX="0.484504" AngleY="0"/>
                                    <RotateTransform CenterX="-0.173449" CenterY="0.506172" Angle="-0.526839"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="10.6678" Height="15.4424" Canvas.Left="1.87555" Canvas.Top="134.643" Stretch="Fill" Data="F1 M 6.91867,149.401L 7.45789,150.085L 10.6029,147.615C 10.6028,147.615 14.3871,144.911 11.3864,141.091C 11.3864,141.091 7.47562,135.684 6.98892,134.643C 6.98892,134.643 6.61484,135.622 3.50046,138.068C 3.50046,138.068 0,140.564 3.2746,144.733L 6.91867,149.401 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.186159,0.442961" EndPoint="1.19629,0.442961">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.186159" CenterY="0.442961" AngleX="-5.11995" AngleY="0"/>
                                    <RotateTransform CenterX="-0.186159" CenterY="0.442961" Angle="4.74309"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="8.26236" Height="12.0352" Canvas.Left="2.95485" Canvas.Top="118.812" Stretch="Fill" Data="F1 M 6.74323,130.306L 7.1514,130.848L 9.64346,128.978C 9.64346,128.978 12.6374,126.938 10.3663,123.911C 10.3663,123.911 7.41382,119.632 7.05273,118.812C 7.05273,118.812 6.74448,119.568 4.27664,121.42C 4.27664,121.42 1.50726,123.304 3.98569,126.607L 6.74323,130.306 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.187528,0.432479" EndPoint="1.2008,0.432479">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.187528" CenterY="0.432479" AngleX="-6.14546" AngleY="0"/>
                                    <RotateTransform CenterX="-0.187528" CenterY="0.432479" Angle="5.59344"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="6.9362" Height="10.2848" Canvas.Left="3.77054" Canvas.Top="103.356" Stretch="Fill" Data="F1 M 6.62814,113.153L 6.94388,113.641L 9.18564,112.195C 9.18564,112.195 11.8664,110.634 10.1103,107.911C 10.1103,107.911 7.84821,104.078 7.58951,103.356C 7.58951,103.356 7.28036,103.983 5.06039,105.415C 5.06039,105.415 2.58096,106.856 4.49734,109.827L 6.62814,113.153 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.190281,0.398926" EndPoint="1.21584,0.398926">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.190281" CenterY="0.398926" AngleX="-9.4652" AngleY="0"/>
                                    <RotateTransform CenterX="-0.190281" CenterY="0.398926" Angle="8.28236"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="5.65721" Height="8.38834" Canvas.Left="4.67795" Canvas.Top="89.7145" Stretch="Fill" Data="F1 M 7.00861,97.7052L 7.26611,98.1029L 9.09451,96.9237C 9.09451,96.9237 11.281,95.6507 9.84866,93.4299C 9.84866,93.4299 8.00369,90.3029 7.79269,89.7145C 7.79269,89.7145 7.54056,90.2259 5.72995,91.3937C 5.72995,91.3937 3.70773,92.5687 5.27072,94.9922L 7.00861,97.7052 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.190284,0.398925" EndPoint="1.21584,0.398925">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.190284" CenterY="0.398925" AngleX="-9.46495" AngleY="0"/>
                                    <RotateTransform CenterX="-0.190284" CenterY="0.398925" Angle="8.28252"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="4.75952" Height="7.05731" Canvas.Left="5.80076" Canvas.Top="76.7377" Stretch="Fill" Data="F1 M 7.7616,83.4604L 7.97824,83.795L 9.51651,82.8029C 9.51651,82.8029 11.356,81.7319 10.151,79.8635C 10.151,79.8635 8.59879,77.2327 8.4213,76.7377C 8.42126,76.7377 8.20914,77.1679 6.68582,78.1504C 6.68582,78.1504 4.9845,79.1389 6.29947,81.1779L 7.7616,83.4604 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.190281,0.398925" EndPoint="1.21585,0.398925">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.190281" CenterY="0.398925" AngleX="-9.4653" AngleY="0"/>
                                    <RotateTransform CenterX="-0.190281" CenterY="0.398925" Angle="8.28244"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="3.9566" Height="5.64755" Canvas.Left="6.54423" Canvas.Top="60.506" Stretch="Fill" Data="F1 M 8.53046,65.9122L 8.73953,66.1535L 9.8494,65.1954C 9.8494,65.1954 11.1894,64.1411 10.0256,62.7931C 10.0256,62.7931 8.50165,60.8789 8.30576,60.506C 8.30576,60.506 8.18533,60.8708 7.08627,61.8197C 7.08627,61.8197 5.84665,62.7932 7.11667,64.2643L 8.53046,65.9122 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.182578,0.464911" EndPoint="1.1872,0.464911">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.182578" CenterY="0.464911" AngleX="-3.03543" AngleY="0"/>
                                    <RotateTransform CenterX="-0.182578" CenterY="0.464911" Angle="2.94236"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                          <Path Width="2.89456" Height="4.29193" Canvas.Left="5.85714" Canvas.Top="37.0711" Stretch="Fill" Data="F1 M 7.04965,41.1595L 7.1814,41.363L 8.11691,40.7596C 8.11691,40.7596 9.23563,40.1083 8.50278,38.972C 8.50278,38.972 7.55881,37.3721 7.45084,37.0711C 7.45084,37.0711 7.32181,37.3327 6.39542,37.9302C 6.39542,37.9302 5.36072,38.5314 6.16043,39.7714L 7.04965,41.1595 Z ">
                            <Path.Fill>
                              <LinearGradientBrush StartPoint="-0.190279,0.398925" EndPoint="1.21583,0.398925">
                                <LinearGradientBrush.RelativeTransform>
                                  <TransformGroup>
                                    <SkewTransform CenterX="-0.190279" CenterY="0.398925" AngleX="-9.46486" AngleY="0"/>
                                    <RotateTransform CenterX="-0.190279" CenterY="0.398925" Angle="8.28248"/>
                                  </TransformGroup>
                                </LinearGradientBrush.RelativeTransform>
                                <GradientStop Color="#FF000000" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                              </LinearGradientBrush>
                            </Path.Fill>
                          </Path>
                        </Canvas>
                      </Viewbox>
                      <Path Stretch="Fill" Fill="#E1FFFFFF" Data="F1 M 309.187,387.786L 314.476,387.585L 313.597,363.293C 313.597,363.293 313.862,335.028 284.357,336.096C 284.357,336.097 243.794,335.952 236.939,334.617C 236.939,334.617 240.409,339.959 241.28,364.014C 241.28,364.014 241.013,390.143 273.211,388.977L 309.187,387.786 Z " HorizontalAlignment="Left" Margin="8.273,5.95,0,0" VerticalAlignment="Top" Width="77.537" Height="54.399"/>
                      <TextBlock TextAlignment="Center" FontFamily="Bodoni MT" FontSize="11" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="18.757,11.996,0,0" Width="60" Foreground="#FF5D5D5D" Text="Drag me on a page to bookmark it" TextWrapping="WrapWithOverflow"/>
                    </Grid>

                  </ControlTemplate>
                </ContentControl.Template>
              </ContentControl>
            </Grid>

          </Grid>

          <ControlTemplate.Triggers>
            <Trigger Property="BookmarksPlacement" Value="Left">
              <Setter TargetName="BookmarksScrollViewer" Property="Grid.Row" Value="1" />
              <Setter TargetName="BookmarksScrollViewer" Property="Grid.Column" Value="1" />
              <Setter TargetName="BookmarksScrollViewer" Property="Grid.ColumnSpan" Value="1" />

              <Setter TargetName="BookmarksScrollViewer" Property="VerticalScrollBarVisibility" Value="Visible" />
              <Setter TargetName="BookmarksScrollViewer" Property="HorizontalScrollBarVisibility" Value="Hidden" />

              <Setter TargetName="BookmarksPanel" Property="Orientation" Value="Vertical" />
            </Trigger>

            <Trigger Property="BookmarksPlacement" Value="Bottom">
              <Setter TargetName="BookmarksScrollViewer" Property="Grid.Row" Value="2" />
            </Trigger>

            <Trigger Property="BookmarksPlacement" Value="Right">
              <Setter TargetName="BookmarksScrollViewer" Property="Grid.Row" Value="1" />
              <Setter TargetName="BookmarksScrollViewer" Property="Grid.Column" Value="4" />
              <Setter TargetName="BookmarksScrollViewer" Property="Grid.ColumnSpan" Value="1" />

              <Setter TargetName="BookmarksScrollViewer" Property="VerticalScrollBarVisibility" Value="Visible" />
              <Setter TargetName="BookmarksScrollViewer" Property="HorizontalScrollBarVisibility" Value="Hidden" />

              <Setter TargetName="BookmarksPanel" Property="Orientation" Value="Vertical" />
            </Trigger>

            <Trigger Property="BookmarkerPlacement" Value="Left">
              <Setter TargetName="PART_Bookmarker"  Property="Grid.Column" Value="0" />
            </Trigger>

            <Trigger Property="BookmarksVisibility" Value="Hidden">
              <Setter TargetName="BookmarksScrollViewer" Property="Visibility" Value="Hidden" />
            </Trigger>

            <Trigger Property="BookmarksVisibility" Value="Collapsed">
              <Setter TargetName="BookmarksScrollViewer" Property="Visibility" Value="Hidden" />
              <Setter TargetName="BookmarksScrollViewer" Property="VerticalScrollBarVisibility" Value="Hidden" />
              <Setter TargetName="BookmarksScrollViewer" Property="HorizontalScrollBarVisibility" Value="Hidden" />
            </Trigger>

          </ControlTemplate.Triggers>

        </ControlTemplate>

      </Setter.Value>
    </Setter>

  </Style>

  <Style TargetType="{x:Type local:BookPage}">

    <Setter Property="Template">
      <Setter.Value>

        <ControlTemplate TargetType="{x:Type local:BookPage}">
          <Grid>
            <!--Page 2 begin-->
            <Border Background="{TemplateBinding Page2Background}">
              <ContentPresenter x:Name="PART_Page2" ContentSource="Page2Content" />
            </Border>
            <!--Page 2 end-->
            <Canvas Opacity="1" Visibility="Hidden">
              <Canvas.Background>
                <LinearGradientBrush StartPoint="0 0" EndPoint="0 0">
                  <GradientStop Color="Transparent" Offset="0" />
                  <GradientStop Color="Black" Offset="0" />
                  <GradientStop Color="Transparent" Offset="1" />
                  <GradientStop Color="Transparent" Offset="1" />
                </LinearGradientBrush>
              </Canvas.Background>
            </Canvas>
            <Grid>
              <Grid.Clip>
                <CombinedGeometry x:Name="PART_ClippingPage0" GeometryCombineMode="Exclude">
                  <CombinedGeometry.Geometry1>
                    <RectangleGeometry />
                  </CombinedGeometry.Geometry1>
                  <CombinedGeometry.Geometry2>
                    <PathGeometry>
                      <PathFigure IsClosed="True" />
                    </PathGeometry>
                  </CombinedGeometry.Geometry2>
                </CombinedGeometry>
              </Grid.Clip>
              <!--Page 0 begin-->
              <Border Background="{TemplateBinding Page0Background}">
                <ContentPresenter x:Name="PART_Page0" ContentSource="Page0Content" />
              </Border>
              <!--Page 0 end-->
            </Grid>
            <Canvas Opacity="1" x:Name="PART_GridShadow" Visibility="Hidden">
              <Canvas.Background>
                <LinearGradientBrush x:Name="PART_PageShadow" StartPoint="0 0" EndPoint="0 0">
                  <GradientStop Color="Transparent" Offset="0" />
                  <GradientStop Color="Black" Offset="0" />
                  <GradientStop Color="Transparent" Offset="1" />
                </LinearGradientBrush>
              </Canvas.Background>
            </Canvas>
            <Grid>
              <Grid.RenderTransform>
                <TransformGroup>
                  <TranslateTransform x:Name="PART_RectangleTranslate" />
                  <RotateTransform x:Name="PART_RectangleRotate" />
                </TransformGroup>
              </Grid.RenderTransform>
              <Grid.Clip>
                <PathGeometry x:Name="PART_ClippingFigure">
                  <PathFigure IsClosed="True" />
                </PathGeometry>
              </Grid.Clip>
              <!--Page 1 begin-->
              <Border Background="{TemplateBinding Page1Background}">
                <ContentPresenter x:Name="PART_Page1" ContentSource="Page1Content" />
              </Border>
              <!--Page 1 end-->
              <Canvas Opacity="0.7" x:Name="PART_CanvasReflection" Visibility="Hidden">
                <Canvas.Background>
                  <LinearGradientBrush x:Name="PART_PageReflection" StartPoint="0 0" EndPoint="0 0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="White" Offset="0.35" />
                    <GradientStop Color="Transparent" Offset="1" />
                  </LinearGradientBrush>
                </Canvas.Background>
              </Canvas>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>

  </Style>

  <Style TargetType="{x:Type local:BookItem}">

    <Setter Property="Padding" Value="5" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="Background">
      <Setter.Value>
        <DrawingBrush Stretch="Fill">
          <DrawingBrush.Drawing>
            <DrawingGroup>
              <DrawingGroup.Children>
                <GeometryDrawing Geometry="F1 M 211.135,154.74L 211.125,87.1143C 211.125,87.1143 214.723,8.21931 132.23,8.21941C 132.23,8.2195 21.0637,5.79155 2.05751,1.3716C 2.0575,1.37166 9.12959,14.5604 9.12958,81.8161C 9.12958,81.8161 5.74103,154.747 95.7621,154.747L 196.098,154.747L 211.135,154.74 Z ">
                  <GeometryDrawing.Brush>
                    <LinearGradientBrush StartPoint="0.0464679,-0.118951" EndPoint="1.49839,-0.118951">
                      <LinearGradientBrush.RelativeTransform>
                        <TransformGroup>
                          <SkewTransform CenterX="0.0464679" CenterY="-0.118951" AngleX="17.4225" AngleY="0"/>
                          <RotateTransform CenterX="0.0464679" CenterY="-0.118951" Angle="55.9458"/>
                        </TransformGroup>
                      </LinearGradientBrush.RelativeTransform>
                      <LinearGradientBrush.GradientStops>
                        <GradientStop Color="#E0ECEFEC" Offset="0"/>
                        <GradientStop Color="#E03A3A3A" Offset="1"/>
                      </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                  </GeometryDrawing.Brush>
                </GeometryDrawing>
                <GeometryDrawing Geometry="F1 M 211.429,154.861L 211.419,87.3135C 211.419,87.3136 215.026,8.50957 132.328,8.50966C 132.328,8.50969 20.8857,6.08461 1.8324,1.66972C 1.83235,1.66982 8.92201,14.8433 8.92197,82.0215C 8.92197,82.0215 5.52502,154.868 95.7695,154.868L 196.354,154.868L 211.429,154.861 Z ">
                  <GeometryDrawing.Pen>
                    <Pen LineJoin="Round" Brush="#E0EBF1EB"/>
                  </GeometryDrawing.Pen>
                </GeometryDrawing>
                <GeometryDrawing Geometry="F1 M 212.403,155.602L 212.392,87.2122C 212.392,87.2122 216.039,7.42519 132.431,7.42525C 132.431,7.42534 19.763,4.96992 0.5,0.500015C 0.499969,0.500076 7.66763,13.8379 7.66762,81.8541C 7.66762,81.8541 4.23328,155.609 95.4707,155.609L 197.162,155.609L 212.403,155.602 Z ">
                  <GeometryDrawing.Pen>
                    <Pen LineJoin="Round" Brush="#E0656565"/>
                  </GeometryDrawing.Pen>
                </GeometryDrawing>
              </DrawingGroup.Children>
            </DrawingGroup>
          </DrawingBrush.Drawing>
        </DrawingBrush>
      </Setter.Value>
    </Setter>

    <Setter Property="Template">
      <Setter.Value>

        <ControlTemplate TargetType="{x:Type local:BookItem}">
          <ControlTemplate.Resources>

            <DrawingBrush x:Key="Couvercle" Stretch="Uniform">
              <DrawingBrush.Drawing>
                <DrawingGroup>
                  <DrawingGroup.Children>
                    <GeometryDrawing Geometry="F1 M 123.881,24.1949C 123.881,32.2029 96.1955,38.6946 62.0432,38.6946C 27.8908,38.6946 0.204895,32.2029 0.204895,24.1949C 0.204895,24.0114 0.219421,23.8288 0.248169,23.6471L 0.188965,23.6474C 0.188965,23.6474 0.217346,23.5927 0.276917,23.4888C 0.527588,22.2628 1.42767,21.0767 2.89816,19.949C 8.62155,13.4072 24.5359,0.453522 60.9598,0.188995C 60.9599,0.188995 104.421,-0.251923 121.68,20.3463C 122.682,21.2024 123.358,22.0901 123.731,23.0849L 123.703,23.085C 123.821,23.4513 123.881,23.8214 123.881,24.1949 Z ">
                      <GeometryDrawing.Pen>
                        <Pen Thickness="0.377953" LineJoin="Round" Brush="#FF000000"/>
                      </GeometryDrawing.Pen>
                      <GeometryDrawing.Brush>
                        <RadialGradientBrush RadiusX="0.946708" RadiusY="2.89756" Center="0.1213,0.304844" GradientOrigin="0.1213,0.304844">
                          <RadialGradientBrush.GradientStops>
                            <GradientStop Color="#FFF4F4F4" Offset="0"/>
                            <GradientStop Color="#FF1F1C42" Offset="1"/>
                          </RadialGradientBrush.GradientStops>
                          <RadialGradientBrush.RelativeTransform>
                            <TransformGroup>
                              <SkewTransform CenterX="0.1213" CenterY="0.304844" AngleX="11.9109" AngleY="0"/>
                              <RotateTransform CenterX="0.1213" CenterY="0.304844" Angle="13.2145"/>
                            </TransformGroup>
                          </RadialGradientBrush.RelativeTransform>
                        </RadialGradientBrush>
                      </GeometryDrawing.Brush>
                    </GeometryDrawing>
                    <GeometryDrawing Geometry="F1 M 62.3179,4.48917C 73.0531,4.48917 81.7554,6.30795 81.7554,8.55167C 81.7554,10.7953 73.0529,12.6142 62.3179,12.6142C 51.5829,12.6142 42.8804,10.7953 42.8804,8.55167C 42.8804,6.30795 51.5826,4.48917 62.3179,4.48917 Z ">
                      <GeometryDrawing.Pen>
                        <Pen Thickness="0.377953" LineJoin="Round" Brush="#FF000000"/>
                      </GeometryDrawing.Pen>
                      <GeometryDrawing.Brush>
                        <LinearGradientBrush StartPoint="1.08842,0.628204" EndPoint="2.00956,0.628204">
                          <LinearGradientBrush.RelativeTransform>
                            <TransformGroup>
                              <SkewTransform CenterX="1.08842" CenterY="0.628204" AngleX="4.88658" AngleY="0"/>
                              <RotateTransform CenterX="1.08842" CenterY="0.628204" Angle="185.11"/>
                            </TransformGroup>
                          </LinearGradientBrush.RelativeTransform>
                          <LinearGradientBrush.GradientStops>
                            <GradientStop Color="#FFABA5C0" Offset="0"/>
                            <GradientStop Color="#FF1D1A46" Offset="1"/>
                          </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                      </GeometryDrawing.Brush>
                    </GeometryDrawing>
                    <GeometryDrawing Geometry="F1 M 81.5262,8.17667C 82.3387,10.5517 78.4243,8.20883 78.4243,8.20883C 73.0054,5.34332 61.7476,5.31985 61.7476,5.31985C 53.9132,5.36014 49.4567,6.39334 46.5887,8.11417C 44.4012,9.4267 42.9637,8.1142 42.9637,8.1142C 42.9637,8.1142 45.2762,0.364166 61.4637,0.280853C 61.4637,0.280853 78.6823,-0.136292 81.5262,8.17667 Z ">
                      <GeometryDrawing.Pen>
                        <Pen Thickness="0.377953" LineJoin="Round" Brush="#FF000000"/>
                      </GeometryDrawing.Pen>
                      <GeometryDrawing.Brush>
                        <LinearGradientBrush StartPoint="0.497218,-0.262261" EndPoint="1.57573,-0.262261">
                          <LinearGradientBrush.RelativeTransform>
                            <TransformGroup>
                              <SkewTransform CenterX="0.497218" CenterY="-0.262261" AngleX="8.00482" AngleY="0"/>
                              <RotateTransform CenterX="0.497218" CenterY="-0.262261" Angle="89.542"/>
                            </TransformGroup>
                          </LinearGradientBrush.RelativeTransform>
                          <LinearGradientBrush.GradientStops>
                            <GradientStop Color="#FFF4F4F4" Offset="0"/>
                            <GradientStop Color="#FF1F1C42" Offset="1"/>
                          </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                      </GeometryDrawing.Brush>
                    </GeometryDrawing>
                  </DrawingGroup.Children>
                </DrawingGroup>
              </DrawingBrush.Drawing>
            </DrawingBrush>

            <DrawingBrush x:Key="Poubelle" Stretch="Uniform">
              <DrawingBrush.Drawing>
                <DrawingGroup>
                  <DrawingGroup.Children>
                    <GeometryDrawing Geometry="F1 M 9.82901,16.4227C -19.7751,104.918 28.0311,163.693 28.3598,164.066C 28.3866,169.595 47.5495,174.089 71.188,174.089C 94.8266,174.089 113.989,169.595 114.002,164.107C 114.341,164.028 163.419,109.698 132.778,15.9788">
                      <GeometryDrawing.Pen>
                        <Pen Thickness="0.377953" LineJoin="Round" Brush="#FF000000"/>
                      </GeometryDrawing.Pen>
                      <GeometryDrawing.Brush>
                        <LinearGradientBrush StartPoint="-0.14106,0.221549" EndPoint="1.13897,0.221549">
                          <LinearGradientBrush.GradientStops>
                            <GradientStop Color="#FFF4F4F4" Offset="0"/>
                            <GradientStop Color="#FF1F1C42" Offset="1"/>
                          </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                      </GeometryDrawing.Brush>
                    </GeometryDrawing>
                    <GeometryDrawing Brush="#FF898989" Geometry="M 71.1511,0.188965C 105.304,0.188965 132.989,6.68073 132.989,14.6888C 132.989,22.6968 105.303,29.1886 71.1511,29.1886C 36.9988,29.1886 9.31281,22.6968 9.31281,14.6888C 9.31281,6.68073 36.9986,0.188965 71.1511,0.188965 Z M 70.727,1.01202C 102.76,1.01202 128.727,7.10077 128.727,14.6118C 128.727,22.1227 102.759,28.2115 70.727,28.2115C 38.6945,28.2115 12.727,22.1227 12.727,14.6118C 12.727,7.10077 38.6943,1.01202 70.727,1.01202 Z ">
                      <GeometryDrawing.Pen>
                        <Pen Thickness="0.377953" LineJoin="Round" Brush="#FF000000"/>
                      </GeometryDrawing.Pen>
                    </GeometryDrawing>
                    <GeometryDrawing Geometry="F1 M 111.694,153.322C 110.349,156.715 106.918,159.638 102.877,158.594L 102.877,158.594C 99.7359,157.782 97.6052,154.951 97.1939,151.32C 120.047,98.9838 116.542,43.4887 116.519,43.5919C 117.445,39.0936 121.389,36.319 125.396,37.3686C 130.889,38.5095 131.052,45.4667 131.052,45.4667C 131.052,45.4667 134.557,100.962 111.695,153.343">
                      <GeometryDrawing.Pen>
                        <Pen Thickness="0.377953" LineJoin="Round" Brush="#FF000000"/>
                      </GeometryDrawing.Pen>
                      <GeometryDrawing.Brush>
                        <LinearGradientBrush StartPoint="0.464862,0.5346" EndPoint="1.30737,0.5346">
                          <LinearGradientBrush.RelativeTransform>
                            <TransformGroup>
                              <SkewTransform CenterX="0.464862" CenterY="0.5346" AngleX="-24.2618" AngleY="0"/>
                              <RotateTransform CenterX="0.464862" CenterY="0.5346" Angle="2.23647"/>
                            </TransformGroup>
                          </LinearGradientBrush.RelativeTransform>
                          <LinearGradientBrush.GradientStops>
                            <GradientStop Color="#FF343250" Offset="0"/>
                            <GradientStop Color="#FFC5C3C3" Offset="1"/>
                          </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                      </GeometryDrawing.Brush>
                    </GeometryDrawing>
                    <GeometryDrawing Geometry="F1 M 33.1689,152.199C 34.5141,155.592 37.9454,158.514 41.9858,157.47L 41.9858,157.47C 45.1272,156.659 47.2579,153.828 47.6692,150.196C 24.8166,97.8605 28.3213,42.3654 28.3442,42.4685C 27.4182,37.9702 23.4738,35.1956 19.4673,36.2452C 13.9741,37.3861 13.8109,44.3434 13.8109,44.3433C 13.8109,44.3433 10.3062,99.8384 33.1679,152.22">
                      <GeometryDrawing.Pen>
                        <Pen Thickness="0.377953" LineJoin="Round" Brush="#FF000000"/>
                      </GeometryDrawing.Pen>
                      <GeometryDrawing.Brush>
                        <LinearGradientBrush StartPoint="-0.0305633,0.511383" EndPoint="0.690112,0.511383">
                          <LinearGradientBrush.RelativeTransform>
                            <TransformGroup>
                              <SkewTransform CenterX="-0.0305633" CenterY="0.511383" AngleX="32.8287" AngleY="0"/>
                              <RotateTransform CenterX="-0.0305633" CenterY="0.511383" Angle="-3.26914"/>
                            </TransformGroup>
                          </LinearGradientBrush.RelativeTransform>
                          <LinearGradientBrush.GradientStops>
                            <GradientStop Color="#FF393754" Offset="0"/>
                            <GradientStop Color="#FFC5C3C3" Offset="1"/>
                          </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                      </GeometryDrawing.Brush>
                    </GeometryDrawing>
                    <GeometryDrawing Geometry="F1 M 28.2895,164.332C 28.2895,164.332 70.1228,178.916 113.873,164.166">
                      <GeometryDrawing.Pen>
                        <Pen Thickness="0.377953" LineJoin="Round" Brush="#FF000000"/>
                      </GeometryDrawing.Pen>
                    </GeometryDrawing>
                    <GeometryDrawing Geometry="F1 M 70.5246,1.08725C 102.557,1.08725 128.525,7.17615 128.525,14.6873C 128.525,22.1983 102.557,28.2872 70.5246,28.2872C 38.492,28.2872 12.5244,22.1983 12.5244,14.6873C 12.5244,7.17615 38.4919,1.08725 70.5246,1.08725 Z ">
                      <GeometryDrawing.Pen>
                        <Pen Thickness="0.377953" LineJoin="Round" Brush="#FF000000"/>
                      </GeometryDrawing.Pen>
                      <GeometryDrawing.Brush>
                        <LinearGradientBrush StartPoint="-0.00162979,0.499999" EndPoint="1.00163,0.499999">
                          <LinearGradientBrush.GradientStops>
                            <GradientStop Color="#FF15123C" Offset="0"/>
                            <GradientStop Color="#FFC5C3C3" Offset="1"/>
                          </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                      </GeometryDrawing.Brush>
                    </GeometryDrawing>
                  </DrawingGroup.Children>
                </DrawingGroup>
              </DrawingBrush.Drawing>
            </DrawingBrush>

            <DrawingGroup x:Key="BookmarkTriangle">
              <DrawingGroup.Children>
                <GeometryDrawing Geometry="M 693.144,1077.96C 668.852,1118.38 717.478,1114.71 717.478,1114.71L 1022.56,1114.71C 1022.56,1114.71 1070.85,1116.35 1044.07,1072.63L 870.606,771.962L 693.144,1077.96 Z M 1006.93,1098.43L 870.589,860.193L 733.293,1098.85C 733.293,1098.85 727.073,1108.24 737.597,1108.75L 1002.67,1108.78C 1002.67,1108.78 1013.34,1109.65 1006.93,1098.43 Z ">
                  <GeometryDrawing.Brush>
                    <LinearGradientBrush StartPoint="0.683839,0.985499" EndPoint="1.72478,0.985499">
                      <LinearGradientBrush.RelativeTransform>
                        <TransformGroup>
                          <SkewTransform CenterX="0.683839" CenterY="0.985499" AngleX="2.01576" AngleY="0"/>
                          <RotateTransform CenterX="0.683839" CenterY="0.985499" Angle="254.567"/>
                        </TransformGroup>
                      </LinearGradientBrush.RelativeTransform>
                      <LinearGradientBrush.GradientStops>
                        <GradientStop Color="#FF565656" Offset="0"/>
                        <GradientStop Color="#FFECEDF1" Offset="1"/>
                      </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                  </GeometryDrawing.Brush>
                </GeometryDrawing>
              </DrawingGroup.Children>
            </DrawingGroup>

            <Storyboard x:Key="PoubelleStoryboard">
              <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFF8A00"/>
                <SplineColorKeyFrame KeyTime="00:00:00.5000000" Value="Red"/>
                <SplineColorKeyFrame KeyTime="00:00:01" Value="#FFFFA200"/>
                <SplineColorKeyFrame KeyTime="00:00:01.5000000" Value="Red"/>
                <SplineColorKeyFrame KeyTime="00:00:02" Value="#FFFF8A00"/>
              </ColorAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1.204"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="1.204"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="1.204"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="1.204"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="-0.011"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="-0.011"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0.244"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="0.204"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="-4"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="-5"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.8000000" Value="-5"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="15"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.8000000" Value="-15"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="-5"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5200000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.7800000" Value="-8"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.0200000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.2800000" Value="-8"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.5200000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.7400000" Value="-8"/>
                <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="OnSelectedSB">
              <ThicknessAnimation To="10" Storyboard.TargetProperty="Padding" Duration="00:00:00.4000000" />
            </Storyboard>

            <Storyboard x:Key="OnUnselectedSB">
              <ThicknessAnimation To="5" Storyboard.TargetProperty="Padding" Duration="00:00:00.4000000" />
            </Storyboard>

          </ControlTemplate.Resources>

          <Grid SnapsToDevicePixels="true">

            <Border 
              x:Name="PART_Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" 
              BorderThickness="{TemplateBinding BorderThickness}"
              VerticalAlignment="Center">

              <Grid x:Name="PART_InnerGrid" Margin="{TemplateBinding Padding}">
                <ContentPresenter 
                  x:Name="PART_ContentPresenter" 
                  HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" 
                  VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" 
                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" />

                <s:SurfacePopup x:Name="PART_DeletePopup" AllowsTransparency="True" StaysOpen="False" PopupAnimation="Fade"
                                Placement="Top" PlacementTarget="{Binding ElementName=PART_InnerGrid}"
                                VerticalOffset="-20" HorizontalOffset="-10">

                  <s:SurfaceButton x:Name="PART_DeleteButton" Width="50" Height="64" Margin="0,20,0,0">
                    <s:SurfaceButton.Template>
                      <ControlTemplate TargetType="{x:Type s:SurfaceButton}">
                        <ContentPresenter />
                      </ControlTemplate>
                    </s:SurfaceButton.Template>

                    <Grid x:Name="grid" RenderTransformOrigin="0.5,0.5">
                      <Grid.RenderTransform>
                        <TransformGroup>
                          <ScaleTransform/>
                          <SkewTransform/>
                          <RotateTransform/>
                          <TranslateTransform/>
                        </TransformGroup>
                      </Grid.RenderTransform>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="0.059*" />
                        <RowDefinition Height="0.148*" />
                        <RowDefinition Height="0.145*" />
                        <RowDefinition Height="0.498*" />
                        <RowDefinition Height="0.15*" />
                      </Grid.RowDefinitions>
                      <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.35*"/>
                        <ColumnDefinition Width="0.3*"/>
                        <ColumnDefinition Width="0.35*"/>
                      </Grid.ColumnDefinitions>
                      <Grid Grid.ColumnSpan="3" Grid.RowSpan="4" Background="{StaticResource Poubelle}" Grid.Row="1" />
                      <Path x:Name="path" Fill="Black" Stretch="Fill" RenderTransformOrigin="0.5,0.5" 
                                Data="M3.8737671,18.292784 C4.1472096,18.292784 4.3841929,18.393047 4.5847173,18.593571 C4.7852416,18.781942 4.8855038,19.018927 4.8855038,19.304522 C4.8855038,19.58404 4.7852416,19.821024 4.5847173,20.015471 C4.3781166,20.209919 4.1411328,20.307144 3.8737671,20.307144 C3.6064012,20.307144 3.3694179,20.209919 3.162817,20.015471 C2.9622924,19.821024 2.8620303,19.58404 2.8620303,19.304522 C2.8620303,19.018927 2.9622924,18.781942 3.162817,18.593571 C3.3633413,18.393047 3.6003246,18.292784 3.8737671,18.292784 z M4.0834064,6.8537779 C4.5452199,6.8537779 4.9796896,6.9145432 5.3868151,7.0360727 C5.7939401,7.1576033 6.1509347,7.3383789 6.4577975,7.5784006 C6.7646608,7.8184223 7.0062013,8.1176891 7.1824198,8.476203 C7.3586383,8.8347158 7.4467478,9.2509565 7.4467478,9.7249231 C7.4467478,10.174583 7.367753,10.575633 7.209764,10.928069 C7.0517755,11.280506 6.8527699,11.60408 6.6127481,11.89879 C6.3727264,12.193501 6.1129565,12.468462 5.8334374,12.723675 C5.5539188,12.978888 5.2941484,13.232581 5.0541267,13.484756 C4.814105,13.736931 4.6150999,13.999739 4.4571109,14.273182 C4.2991219,14.546623 4.2201276,14.84741 4.2201276,15.175541 C4.2201276,15.45506 4.2535481,15.708754 4.3203897,15.936623 C4.3872313,16.164492 4.4540725,16.35742 4.5209141,16.515409 L3.0534399,16.515409 C2.9987514,16.35742 2.9501395,16.152338 2.907604,15.900164 C2.8650684,15.647989 2.8438008,15.397333 2.8438008,15.148197 C2.8438008,14.759301 2.9212761,14.408383 3.0762267,14.095444 C3.2311776,13.782504 3.4241064,13.489313 3.6550131,13.215871 C3.88592,12.942429 4.1380949,12.67962 4.4115372,12.427445 C4.6849794,12.17527 4.9371543,11.920057 5.1680613,11.661807 C5.3989677,11.403556 5.5918965,11.133151 5.7468476,10.850595 C5.9017982,10.568037 5.9792733,10.256617 5.9792733,9.9163332 C5.9792733,9.6246605 5.9230657,9.3664093 5.8106508,9.1415796 C5.6982355,8.916749 5.5448041,8.7283773 5.3503561,8.5764647 C5.1559081,8.4245529 4.9310775,8.3106184 4.6758647,8.2346621 C4.4206519,8.1587057 4.1502476,8.1207275 3.8646524,8.1207275 C2.8377242,8.1207275 1.9475174,8.5248146 1.1940317,9.3329887 L1.1940317,7.7287941 C2.1237359,7.1454496 3.0868607,6.8537779 4.0834064,6.8537779 z" 
                                Grid.Column="1" Grid.Row="3">
                        <Path.RenderTransform>
                          <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                          </TransformGroup>
                        </Path.RenderTransform>
                      </Path>
                      <Rectangle x:Name="rectangle" Fill="{StaticResource Couvercle}" Grid.ColumnSpan="3" Grid.RowSpan="2" 
                                     RenderTransformOrigin="0.5,0.5">
                        <Rectangle.RenderTransform>
                          <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                          </TransformGroup>
                        </Rectangle.RenderTransform>
                      </Rectangle>
                    </Grid>

                  </s:SurfaceButton>

                </s:SurfacePopup>

              </Grid>

            </Border>

          </Grid>

          <ControlTemplate.Triggers>
            <Trigger Property="BookmarksPlacement" Value="Left">
              <Setter Property="Padding" Value="2" />
            </Trigger>

            <Trigger Property="BookmarksPlacement" Value="Right">
              <Setter Property="Padding" Value="2" />
            </Trigger>

            <Trigger Property="BookmarksVisibility" Value="Collapsed">
              <Setter Property="Visibility" Value="Collapsed" />
            </Trigger>

            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="False" />
                <Condition Property="Header" Value="{x:Null}" />
              </MultiTrigger.Conditions>
              <Setter Property="Visibility" Value="Collapsed" />
            </MultiTrigger>

            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="True" />
                <Condition Property="Header" Value="{x:Null}" />
              </MultiTrigger.Conditions>

              <Setter Property="Width" Value="15" />
              <Setter Property="Height" Value="15" />
              <Setter Property="Margin" Value="3" />

            </MultiTrigger>

            <!-- bookmarker top-->
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="True" />
                <Condition Property="Header" Value="{x:Null}" />
                <Condition Property="BookmarksPlacement" Value="Top" />
              </MultiTrigger.Conditions>

              <Setter Property="Background">
                <Setter.Value>
                  <DrawingBrush Drawing="{StaticResource BookmarkTriangle}" Stretch="Uniform" />
                </Setter.Value>
              </Setter>
              <Setter Property="VerticalAlignment" Value="Bottom" />
            </MultiTrigger>

            <!-- bookmarker Left -->
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="True" />
                <Condition Property="Header" Value="{x:Null}" />
                <Condition Property="BookmarksPlacement" Value="Left" />
              </MultiTrigger.Conditions>

              <Setter Property="Background">
                <Setter.Value>
                  <DrawingBrush Drawing="{StaticResource BookmarkTriangle}" Stretch="Uniform">
                    <DrawingBrush.RelativeTransform>
                      <RotateTransform CenterX="0.5" CenterY="0.5" Angle="-90" />
                    </DrawingBrush.RelativeTransform>
                  </DrawingBrush>
                </Setter.Value>
              </Setter>
              <Setter Property="HorizontalAlignment" Value="Right" />
            </MultiTrigger>

            <!-- bookmarker Right -->
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="True" />
                <Condition Property="Header" Value="{x:Null}" />
                <Condition Property="BookmarksPlacement" Value="Right" />
              </MultiTrigger.Conditions>

              <Setter Property="Background">
                <Setter.Value>
                  <DrawingBrush Drawing="{StaticResource BookmarkTriangle}" Stretch="Uniform">
                    <DrawingBrush.RelativeTransform>
                      <RotateTransform CenterX="0.5" CenterY="0.5" Angle="90" />
                    </DrawingBrush.RelativeTransform>
                  </DrawingBrush>
                </Setter.Value>
              </Setter>
              <Setter Property="HorizontalAlignment" Value="Left" />
            </MultiTrigger>

            <!-- bookmarker Bottom -->
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="True" />
                <Condition Property="Header" Value="{x:Null}" />
                <Condition Property="BookmarksPlacement" Value="Bottom" />
              </MultiTrigger.Conditions>

              <Setter Property="Background">
                <Setter.Value>
                  <DrawingBrush Drawing="{StaticResource BookmarkTriangle}" Stretch="Uniform">
                    <DrawingBrush.RelativeTransform>
                      <RotateTransform CenterX="0.5" CenterY="0.5" Angle="180" />
                    </DrawingBrush.RelativeTransform>
                  </DrawingBrush>
                </Setter.Value>
              </Setter>
              <Setter Property="VerticalAlignment" Value="Top" />
            </MultiTrigger>

            <Trigger Property="IsSelected" Value="True">

              <Trigger.EnterActions>
                <BeginStoryboard x:Name="OnSelectedBSB" Storyboard="{StaticResource OnSelectedSB}" />
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <StopStoryboard BeginStoryboardName="OnSelectedBSB" />
                <BeginStoryboard Storyboard="{StaticResource OnUnselectedSB}" />
              </Trigger.ExitActions>

            </Trigger>
          </ControlTemplate.Triggers>

        </ControlTemplate>

      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>
